import QtQuick
        import QtQuick.Controls
        import QtQuick.Layouts
        import QtQuick.Window



        Window {
        id: dialog
        width: 300
        height: 100
        flags: Qt.Popup
        modality: Qt.ApplicationModal
        x: Screen.width/2-width/2
        y: Screen.height/2-height/2

        Column{
        anchors.fill: parent
        Rectangle{
        width: parent.width
        height: 30
        color: "silver"
        Text{
        width: contentWidth
        height: parent.height
        Layout.alignment: Qt.AlignHCenter
        text: "信息提示"
        }

        Button{
        anchors.right: parent.right
        height: parent.height
        width: height

        }
        }
        Rectangle{
        width: parent.width
        height: 200
        //color: "transparent"
        Text{
        width: parent.width
        anchors.centerIn: parent
        text: "Popup Window"
        font.pixelSize: 30
        focus: true
        wrapMode: Text.Wrap
        }
        }
        Rectangle{
        width: parent.width
        height: 50

        Button{
        id: btnOk
        focus: true
        width: 100
        text:"确定"
        background: Rectangle {
        implicitWidth: 100
        implicitHeight: 40
        color: parent.down ? "red" : "green"  // 设置按下和释放的背景颜色
        radius: 7
        border.width: 2
        border.color: parent.down ? "green" : "red"
        }
        height: parent.height
        anchors.centerIn: parent

        onClicked: {
        dialog.hide();
        }
        Keys.onReturnPressed: {
        dialog.hide();
        }
        }
        }
        }

        onActiveChanged: {
        if(active == true)
        {
        btnOk.forceActiveFocus();
        }
        }
        }